// 获取所有的li标签按钮
let XuanXiangKaList = document.querySelector('.XuanXiangKaList')

let listLi = document.querySelectorAll('.mIListul li')
console.log(listLi);
listLi.forEach((Ali, i) => {

    console.log(Ali); //获取到每一个li
    // let XuanXiangKa = XuanXiangKaList[i] // 每一个按钮都对应这每一组数据

    // 鼠标 点击li标签的时候 变颜色
    Ali.onmouseenter = function () {
        // Ali.style.color = '#FF6700'
        // console.log(XuanXiangKaList);
        XuanXiangKaList.style.display = 'block'

        all(i)
    }
    XuanXiangKaList.onmouseleave = function () {

        // Ali.style.color = 'black'
        XuanXiangKaList.style.display = 'none'

    }


})

function all(i) {

    let AllArr = [xiaomiArr, RedmiArr, PhoneArr, TvArr, computerArr, HomeArr, CatArr, AiArr]
    let qqq = AllArr[i]
    let res = qqq.map(obj =>
        `<li>
        <img src="${obj.img}" alt="">
        </li>`
    )
// <button class="Add_btn">添加购物车</button>
{/* <p class="p_name">${obj.name}</p>
        <p class="p_price">${obj.price}</p> */}
    // let XuanXiangKaList = document.querySelector('.XuanXiangKaList')
    XuanXiangKaList.innerHTML = res.join('')}